package cn.damai.search.baseService.ipml;

import cn.damai.search.baseService.BaseSchedulerSeatService;
import cn.damai.search.mapper.SchedulerSeatMapper;
import cn.damai.model.SchedulerSeat;
import cn.damai.util.DubboUtil;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;

import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Component
@Service(version = DubboUtil.VRESION,group = DubboUtil.GROUP)
public class BaseSchedulerSeatServiceIpml implements BaseSchedulerSeatService {

    @Autowired
    private SchedulerSeatMapper schedulerSeatMapper;

    @Override
    public SchedulerSeat getSchedulerSeatById(@RequestParam Long id){
        return schedulerSeatMapper.getSchedulerSeatById(id);
    }

    @Override
    public List<SchedulerSeat>	getSchedulerSeatListByMap(@RequestParam Map<String,Object> param){
        return schedulerSeatMapper.getSchedulerSeatListByMap(param);
    }

    @Override
    public Integer getSchedulerSeatCountByMap(@RequestParam Map<String,Object> param){
        return schedulerSeatMapper.getSchedulerSeatCountByMap(param);
    }

    @Override
    public Integer qdtxAddSchedulerSeat(@RequestParam SchedulerSeat SchedulerSeat){
        SchedulerSeat.setCreatedTime(new Date());
        return schedulerSeatMapper.insertSchedulerSeat(SchedulerSeat);
     }

    @Override
    public Integer qdtxModifySchedulerSeat(@RequestParam SchedulerSeat SchedulerSeat){
            SchedulerSeat.setUpdatedTime(new Timestamp(new Date().getTime()));
        return schedulerSeatMapper.updateSchedulerSeat(SchedulerSeat);
     }
}
